<?php
//FIFO first in first out
class Queue
{
	private $arr = array();
	
	public function __construct(array $arr)
	{
		$this->arr = $arr;
	}
	
	public function insert($item)
	{
		//inset to the start of the array
		array_unshift($this->arr, $item);
	}
	
	public function get()
	{
		//return the last elemnt in the array
		return array_pop($this->arr);
	}
	
	public function getData()
	{
		return $this->arr;
	}
}

$queue = new Queue(array());
$queue->insert('first');
$queue->insert('secound');
var_dump($queue->get());